﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Animal
    {
        private int Leg;
        public int leg 
        {
            get { return this.Leg; }
            set { this.Leg = value; }
        }
        public void Hello() 
        {
            Console.WriteLine("我有{}只脚",this.Leg);
        }
        public void Walk() 
        {
            Console.WriteLine("行动方式为走路");
        }
        public virtual void Eat()
        {
            Console.WriteLine("通过吃饭获取能量");
        }
        public void Sleep() 
        {
            Console.WriteLine("休息方式是睡觉");
        }
        public virtual void Cry() 
        {
            Console.WriteLine("可以发出叫声");
        }
    }
}
